<?php
class Rawdata {
	
	private $dbconn;
	
	public function Rawdata($dbconn) {
		$this->dbconn = $dbconn;
	}
	
	
	public function getGeneralDataByVariable($userid, $varArray = null) {
		if(null != $varArray) {
			$toGet = implode(",",$varArray);
			$query = "SELECT ".$toGet." FROM data_general WHERE userid='".$userid."';";
			
		} else {
			$query = "SELECT * FROM data_general WHERE userid='".$userid."';";
		}

		$res = mysql_query($query, $this->dbconn);
		$ret = array();
		while($row = mysql_fetch_assoc($res)) {
			$ret[] = $row;
		}
		
		return $ret;
	}
	
}